home *** CD-ROM | disk | FTP | other *** search
/ Hyper Stacks 1994 May / Hyper Stacks (Pacific HiTech)(1994)[Mac].iso / Organization / XrefText5 / XrefText5 / background_2642.txt < prev    next >
Text File  |  1988-02-09  |  13KB  |  503 lines

  1. -- background: 2642 from stack: in
  2. -- bmap block id: 3154
  3. -- flags: 0000
  4. -- background id: 0
  5. -- name: 
  6. ----- HyperTalk script -----
  7. on opencard
  8.   set lockText of field body to true
  9.   hide bkgnd button "Lock"
  10.   show bkgnd button "Edit"
  11. end opencard
  12.  
  13. on closecard
  14.   set lockText of field body to true
  15.   hide bkgnd button "Lock"
  16.   show bkgnd button "Edit"
  17. end closecard
  18.  
  19.  
  20. -- part 1 (field)
  21. -- low flags: 01
  22. -- high flags: 2007
  23. -- rect: left=13 top=61 right=292 bottom=494
  24. -- title width / last selected line: 0
  25. -- icon id / first selected line: 0 / 0
  26. -- text alignment: 0
  27. -- font id: 20
  28. -- text size: 12
  29. -- style flags: 0
  30. -- line height: 14
  31. -- part name: body
  32. ----- HyperTalk script -----
  33. on mouseUp
  34.   put the optionkey into keystate
  35.   if the selection is empty then
  36.     set lockText of the target to false
  37.     repeat two times
  38.       click at the clickLoc
  39.     end repeat
  40.     put the selection into holder
  41.     if keystate is down then
  42.       type holder & "*"
  43.       push card
  44.       find holder in field keywords
  45.       if the result is not empty then
  46.         doMenu New Card
  47.         put holder into field keywords
  48.         set the name of this card to holder
  49.         get the number of lines in card field finder of card theIndex
  50.         put holder into line it+1 of card field finder of card theIndex
  51.       else
  52.         put the length of holder into hl
  53.         put the length of word 1 of field keywords into kl
  54.         if hl<>kl then
  55.           answer "Close match but not exact!" with "Good Enough" or "New Card"
  56.           if it contains "New" then
  57.             set lockscreen to true
  58.             go prev
  59.             doMenu New Card
  60.             put holder into field keywords
  61.             set the name of this card to holder
  62.             get the number of lines in card field finder of card theIndex
  63.             put holder into line it+1 of card field finder of card theIndex
  64.             set lockscreen to false
  65.           end if
  66.         end if
  67.       end if
  68.     else
  69.       push card
  70.       visual effect wipe right to black
  71.       visual effect wipe left
  72.       find holder in field keywords -- This line is the link
  73.       if the result is not empty then
  74.         answer "No match for keyword " "e& holder"e
  75.         pop card
  76.       end if
  77.     end if
  78.   end if
  79.   click at 0,0 --disable selection
  80.   set lockText of the target to true
  81. end mouseUp
  82.  
  83.  
  84.  
  85. -- part 2 (field)
  86. -- low flags: 01
  87. -- high flags: 2004
  88. -- rect: left=36 top=41 right=66 bottom=201
  89. -- title width / last selected line: 0
  90. -- icon id / first selected line: 0 / 0
  91. -- text alignment: 0
  92. -- font id: 20
  93. -- text size: 12
  94. -- style flags: 256
  95. -- line height: 14
  96. -- part name: keywords
  97.  
  98.  
  99. -- part 7 (button)
  100. -- low flags: 00
  101. -- high flags: 0000
  102. -- rect: left=341 top=0 right=27 bottom=361
  103. -- title width / last selected line: 0
  104. -- icon id / first selected line: 0 / 0
  105. -- text alignment: 1
  106. -- font id: 0
  107. -- text size: 12
  108. -- style flags: 0
  109. -- line height: 16
  110. -- part name: Back
  111. ----- HyperTalk script -----
  112. on mouseUp
  113.   if the number of this card = 1 then
  114.     answer "Careful. You might leave this stack." with Cancel or OK
  115.     if it = "OK" then
  116.       visual effect wipe left to black
  117.       visual effect wipe right
  118.       go back
  119.     else
  120.       exit mouseup
  121.     end if
  122.   else
  123.     visual effect wipe left to black
  124.     visual effect wipe right
  125.     go back
  126.   end if
  127. end mouseUp
  128.  
  129.  
  130.  
  131. -- part 8 (button)
  132. -- low flags: 00
  133. -- high flags: 0000
  134. -- rect: left=366 top=0 right=27 bottom=385
  135. -- title width / last selected line: 0
  136. -- icon id / first selected line: 0 / 0
  137. -- text alignment: 1
  138. -- font id: 0
  139. -- text size: 12
  140. -- style flags: 0
  141. -- line height: 16
  142. -- part name: New Stack
  143. ----- HyperTalk script -----
  144. on mouseUp
  145.   put the short name of this stack into checker
  146.   doMenu New Stack...
  147.   get the short name of this stack
  148.   if it = checker then exit mouseup
  149.   put it into field "keywords"
  150.   push card
  151.   go back
  152.   ---
  153.   go to second card
  154.   doMenu "Copy Card"
  155.   pop card
  156.   doMenu "Paste Card"
  157.   push card
  158.   ---
  159.   go to first card of stack checker
  160.   doMenu "Copy Card"
  161.   pop card
  162.   go prev
  163.   doMenu "Paste Card"
  164.   click at the loc of button "Re-Index"
  165. end mouseUp
  166.  
  167.  
  168.  
  169. -- part 9 (button)
  170. -- low flags: 00
  171. -- high flags: 0000
  172. -- rect: left=293 top=0 right=27 bottom=312
  173. -- title width / last selected line: 0
  174. -- icon id / first selected line: 0 / 0
  175. -- text alignment: 1
  176. -- font id: 0
  177. -- text size: 12
  178. -- style flags: 0
  179. -- line height: 16
  180. -- part name: Home
  181. ----- HyperTalk script -----
  182. on mouseUp
  183.   visual effect iris close to black
  184.   visual effect iris open to white
  185.   go home
  186. end mouseUp
  187.  
  188.  
  189.  
  190. -- part 12 (button)
  191. -- low flags: 80
  192. -- high flags: 8004
  193. -- rect: left=355 top=72 right=98 bottom=384
  194. -- title width / last selected line: 0
  195. -- icon id / first selected line: 0 / 0
  196. -- text alignment: 1
  197. -- font id: 0
  198. -- text size: 12
  199. -- style flags: 0
  200. -- line height: 16
  201. -- part name: OK
  202. ----- HyperTalk script -----
  203. on mouseUp
  204.   hide bkgnd button OK
  205.   show field body
  206. end mouseUp
  207.  
  208.  
  209.  
  210. -- part 17 (button)
  211. -- low flags: 00
  212. -- high flags: 0000
  213. -- rect: left=317 top=0 right=27 bottom=338
  214. -- title width / last selected line: 0
  215. -- icon id / first selected line: 0 / 0
  216. -- text alignment: 1
  217. -- font id: 0
  218. -- text size: 12
  219. -- style flags: 0
  220. -- line height: 16
  221. -- part name: first card
  222. ----- HyperTalk script -----
  223. on mouseUp
  224.   if the number of this card > 1 then
  225.     -- visual effect wipe down to black
  226.     visual effect iris close to white
  227.     visual effect dissolve
  228.     go to first card
  229.   else
  230.     play boing
  231.     answer "You're already at the first card!"
  232.   end if
  233. end mouseUp
  234.  
  235.  
  236.  
  237. -- part 18 (button)
  238. -- low flags: 00
  239. -- high flags: 8004
  240. -- rect: left=203 top=52 right=68 bottom=241
  241. -- title width / last selected line: 0
  242. -- icon id / first selected line: 0 / 0
  243. -- text alignment: 1
  244. -- font id: 0
  245. -- text size: 12
  246. -- style flags: 0
  247. -- line height: 16
  248. -- part name: Edit
  249. ----- HyperTalk script -----
  250. on mouseUp
  251.   set lockText of field body to false
  252.   show bkgnd button "Lock"
  253.   hide bkgnd button "Edit"
  254. end mouseUp
  255.  
  256.  
  257.  
  258. -- part 19 (button)
  259. -- low flags: 80
  260. -- high flags: 8004
  261. -- rect: left=205 top=41 right=58 bottom=242
  262. -- title width / last selected line: 0
  263. -- icon id / first selected line: 0 / 0
  264. -- text alignment: 1
  265. -- font id: 0
  266. -- text size: 12
  267. -- style flags: 0
  268. -- line height: 16
  269. -- part name: Lock
  270. ----- HyperTalk script -----
  271. on mouseUp
  272.   set lockText of field body to true
  273.   hide bkgnd button "Lock"
  274.   show bkgnd button "Edit"
  275. end mouseUp
  276.  
  277.  
  278.  
  279. -- part 21 (button)
  280. -- low flags: 00
  281. -- high flags: 0000
  282. -- rect: left=269 top=0 right=27 bottom=289
  283. -- title width / last selected line: 0
  284. -- icon id / first selected line: 0 / 0
  285. -- text alignment: 1
  286. -- font id: 0
  287. -- text size: 12
  288. -- style flags: 0
  289. -- line height: 16
  290. -- part name: ?
  291. ----- HyperTalk script -----
  292. on mouseUp
  293.   visual effect dissolve
  294.   go card ayuda
  295. end mouseUp
  296.  
  297.  
  298.  
  299. -- part 32 (button)
  300. -- low flags: 00
  301. -- high flags: 0000
  302. -- rect: left=388 top=0 right=27 bottom=409
  303. -- title width / last selected line: 0
  304. -- icon id / first selected line: 0 / 0
  305. -- text alignment: 1
  306. -- font id: 0
  307. -- text size: 12
  308. -- style flags: 0
  309. -- line height: 16
  310. -- part name: Import Text
  311. ----- HyperTalk script -----
  312. on mouseUp
  313.   if the number of this card > 2 then
  314.     if field body is empty then
  315.       put FileName("TEXT") into theFile
  316.       if theFile is not empty then
  317.         open file theFile
  318.         read from file theFile for 16000
  319.         put it into bkgnd field body
  320.         close file theFile
  321.       end if
  322.     else
  323.       answer "Import Text: Replace or Add to field contents?" with "Replace" or "Add" or "Cancel"
  324.       if it = "Cancel" then exit mouseup
  325.       if it = "Replace" then
  326.         put FileName("TEXT") into theFile
  327.         if theFile is not empty then
  328.           open file theFile
  329.           read from file theFile for 16000
  330.           put it into bkgnd field body
  331.           close file theFile
  332.         end if
  333.       else
  334.         put return after last line of bkgnd field body
  335.         put FileName("TEXT") into theFile
  336.         if theFile is not empty then
  337.           open file theFile
  338.           read from file theFile for 16000
  339.           put the number of lines in field body into liner
  340.           put it after line liner of bkgnd field body
  341.           close file theFile
  342.         end if
  343.       end if
  344.     end if
  345.   else
  346.     play boing
  347.     Answer "Don't import to Index or Help Card!"
  348.   end if
  349. end mouseUp
  350.  
  351.  
  352.  
  353. -- part 33 (button)
  354. -- low flags: 00
  355. -- high flags: 0000
  356. -- rect: left=412 top=0 right=27 bottom=431
  357. -- title width / last selected line: 0
  358. -- icon id / first selected line: 0 / 0
  359. -- text alignment: 1
  360. -- font id: 0
  361. -- text size: 12
  362. -- style flags: 0
  363. -- line height: 16
  364. -- part name: pict
  365. ----- HyperTalk script -----
  366. on mouseUp
  367.   if the number of this card > 2 then
  368.     answer "Change to Picture or Text?" with Text or Picture
  369.     if it contains "Text" then
  370.       show tool window
  371.       choose select tool
  372.       doMenu Select All
  373.       doMenu Clear Picture
  374.       choose browse tool
  375.       hide tool window
  376.       hide pattern window
  377.     else
  378.       show pattern window
  379.       show tool window
  380.       choose rectangle tool
  381.       set filled to false
  382.       drag from (item 1 of the rect of field keywords), (item 2 of the rect of field keywords) to ((item 3 of the rect of field keywords)-30), (item 4 of the rect of field keywords)
  383.       drag from 0,28 to 512,342
  384.       choose bucket tool
  385.       set pattern to 1
  386.       click at 250,250
  387.       choose text tool
  388.       set the textfont to Geneva
  389.       set the textsize to 9
  390.       click at 10,320
  391.       type "Don't use eraser. Use white brush instead."
  392.       click at 10,330
  393.       type "Command-Space will toggle the menubar on or off."
  394.       choose brush tool
  395.     end if
  396.   else
  397.     play boing
  398.     answer "Uh-uh. You don't want to change this card."
  399.   end if
  400. end mouseUp
  401.  
  402.  
  403.  
  404. -- part 36 (button)
  405. -- low flags: 00
  406. -- high flags: 0000
  407. -- rect: left=436 top=0 right=27 bottom=457
  408. -- title width / last selected line: 0
  409. -- icon id / first selected line: 0 / 0
  410. -- text alignment: 1
  411. -- font id: 0
  412. -- text size: 12
  413. -- style flags: 0
  414. -- line height: 16
  415. -- part name: output
  416. ----- HyperTalk script -----
  417. on mouseUp
  418.   answer "Output to printer or to text file?" with "Printer" or "File" or "Cancel"
  419.   if it = "Cancel" then
  420.     exit mouseup
  421.   else if it = "Printer" then
  422.     answer "Print the stack or a report of its text" with "Stack" or "Report" or "Cancel"
  423.     if it = "Cancel" then
  424.       exit mouseup
  425.     else if it = "Stack" then
  426.       doMenu Print Stack...
  427.     else if it = "Report" then
  428.       doMenu Print Report...
  429.     end if
  430.   else if it = "File" then
  431.     answer "Save a file of the Stack or of this Card?" with "Stack" or "Card" or "Cancel"
  432.     if it = "Cancel" then
  433.       exit mouseup
  434.     else if it = "Stack" then
  435.       put the number of cards into counter
  436.       go to first card
  437.       put the short name of this stack & ".text" into tfilename
  438.       Get PutFile("Save text as:",tfilename)
  439.       if it is empty then exit mouseup
  440.       put it into textfile
  441.       set cursor to 4
  442.       set the loc of message to 10,120
  443.       put "Writing to file " & textfile & ".  Please wait..."into message
  444.       open file textfile
  445.       repeat (counter - 1)
  446.         go next card
  447.         write field keywords to file textfile
  448.         write return to file textfile
  449.         write field body to file textfile
  450.         write return to file textfile
  451.         write return to file textfile
  452.       end repeat
  453.       close file textfile
  454.       go first card
  455.       play harpsichord c e g bb
  456.       flash 1
  457.       put "Done." into message
  458.       wait 2 seconds
  459.       hide message
  460.     else if it = "Card" then
  461.       put the short name of this card & ".text" into tfilename
  462.       Get PutFile("Save text as:",tfilename)
  463.       if it is empty then exit mouseup
  464.       put it into textfile
  465.       open file textfile
  466.       write field keywords to file textfile
  467.       write return to file textfile
  468.       write field body to file textfile
  469.       close file textfile
  470.     end if
  471.   end if
  472. end mouseUp
  473.  
  474.  
  475.  
  476. -- part 40 (button)
  477. -- low flags: 00
  478. -- high flags: 0000
  479. -- rect: left=250 top=316 right=341 bottom=295
  480. -- title width / last selected line: 0
  481. -- icon id / first selected line: 0 / 0
  482. -- text alignment: 1
  483. -- font id: 0
  484. -- text size: 12
  485. -- style flags: 0
  486. -- line height: 16
  487. -- part name: DeleteCard
  488. ----- HyperTalk script -----
  489. on mouseUp
  490.   if the number of this card >1 then
  491.     answer "OK to delete this card?" with "OK" or "Cancel"
  492.     if it = "OK" then
  493.       doMenu Delete Card
  494.       go card theIndex
  495.       click at the loc of button "Re-Index"
  496.     end if
  497.   else
  498.     play boing
  499.     answer "Uh-uh. You don't want to delete this card."
  500.   end if
  501. end mouseUp
  502.  
  503.